package com.sharemarking.wa.platform.controller;

import com.sharemarking.wa.common.ResponseParams;
import com.sharemarking.wa.platform.service.AgreementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author dxy
 */
@RestController
@RequestMapping(value = "agreement")
public class AgreementController {
    @Autowired
    AgreementService agreementService;

    /**
     * 获取协议列表
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "getAgreementInfo")
    public ResponseParams<?> getAgreementInfo() throws Exception {
        return agreementService.getAgreementInfo();
    }


    /**
     * 获取经营单位协议列表
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "getOrgAgreementList")
    public ResponseParams<?> getOrgAgreementList() throws Exception {
        return agreementService.getOrgAgreementList();
    }

    /**
     * 新增协议
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "addAgreement")
    public ResponseParams<?> addAgreement() throws Exception {
        return agreementService.addAgreement();
    }

    /**
     * 删除协议
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "deleteAgreement")
    public ResponseParams<?> deleteAgreement() throws Exception {
        return agreementService.deleteAgreement();
    }

    @RequestMapping(value = "isOrgAgreementExpired")
    public ResponseParams<?> isOrgAgreementExpired() throws Exception{
        return agreementService.isOrgAgreementExpired();
    }
}
